package com.ssm.hj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.PhysiqueSearch;
import com.ssm.hj.service.PhysiqueService;
import com.ssm.hj.view.MemberView;
import com.ssm.hj.view.MouldView;
import com.ssm.mapper.PhysiqueMapper;
import com.ssm.pojo.Physique;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PhysiqueServiceImpl implements PhysiqueService {
    @Resource
    private PhysiqueMapper physiqueMapper;
    @Override
    //阿杰 查询体检
    public PageInfo<Physique> queryPhysiqueAllService(Page<PhysiqueSearch> page) throws Exception {
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo<Physique>(this.physiqueMapper.queryPhysiqueAll(page.getSearchObj()));
    }

    @Override
    //阿杰 查询已经预约
    public MemberView queryBookingStateService(String card) throws Exception {
        return this.physiqueMapper.queryBookingState(card);
    }

    @Override
    //新增问卷
    public int savePhysiqueService(Physique physique) throws Exception {
        return this.physiqueMapper.savePhysique(physique);
    }

}
